package com.pur.zsms.photomanage.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import javax.annotation.Resource;

import net.sf.cglib.beans.BeanCopier;

import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Service;

import com.pur.zsms.common.exception.GenericException;
import com.pur.zsms.common.support.PageController;
import com.pur.zsms.common.support.PaginationSupport;
import com.pur.zsms.common.util.CipherUtil;
import com.pur.zsms.common.util.PubFun;
import com.pur.zsms.foodmanage.food.dao.IFoodDao;
import com.pur.zsms.foodmanage.food.po.FoodMaterPo;
import com.pur.zsms.foodmanage.food.po.FoodPo;
import com.pur.zsms.foodmanage.food.service.IFoodService;
import com.pur.zsms.foodmanage.food.vo.FoodMaterVo;
import com.pur.zsms.foodmanage.food.vo.FoodVo;
import com.pur.zsms.photomanage.dao.IPhotoDao;
import com.pur.zsms.photomanage.po.PhotoPo;
import com.pur.zsms.photomanage.service.IPhotoService;
import com.pur.zsms.photomanage.vo.PhotoVo;
import com.pur.zsms.pmsnmanage.menu.po.MenuPo;
import com.pur.zsms.pmsnmanage.role.po.RolePo;
import com.pur.zsms.pmsnmanage.role.vo.RoleVo;
import com.pur.zsms.pmsnmanage.user.dao.IUserDao;
import com.pur.zsms.pmsnmanage.user.po.UserPo;
import com.pur.zsms.pmsnmanage.user.po.UserRolePo;
import com.pur.zsms.pmsnmanage.user.service.IUserService;
import com.pur.zsms.pmsnmanage.user.vo.UserVo;

@Service("photoService")
public class PhotoServiceImpl implements IPhotoService {

	@Resource(name = "photoDao")
	private IPhotoDao photoDaoImpl;

	public IPhotoDao getPhotoDaoImpl() {
		return photoDaoImpl;
	}

	public void setPhotoDaoImpl(IPhotoDao photoDaoImpl) {
		this.photoDaoImpl = photoDaoImpl;
	}

	public PaginationSupport findPhoto(PageController pageController, PhotoVo photoVo)
	        throws GenericException {
		return photoDaoImpl.findPhoto(pageController, photoVo);
	}

	public PhotoPo addPhotoPo(PhotoVo c) throws GenericException {
		PhotoPo po = new PhotoPo();
		BeanCopier copier = BeanCopier.create(PhotoVo.class, PhotoPo.class, false);
		copier.copy(c, po, null);
		return photoDaoImpl.addPhotoPo(po);
	}
}
